/**
 * @param {*} instance vue的this
 * @param {*} params 请求参数
 * @returns Promise
 */


// 获取当天曲线 Today’s alarm analysis
export function getTodayCurve(instance, params = {}){
  return new Promise(function(resolve, reject){
    if (instance) {
      instance.proxy.$http.get('alarmManagement.getTodayCurve',{ params }).then(res=>{
        resolve(res)
      })
      .catch(err => reject(err))
    }
  })
}
// 获取告警城市排名  Ranking of alarms for stationed units
export function getAlarmUnitRank(instance, params = {}){
  return new Promise(function(resolve, reject){
    if (instance) {
      instance.proxy.$http.get('alarmManagement.getCityAlarmRank',{ params }).then(res=>{
      // instance.proxy.$http.get('alarmManagement.getAmbulanceVennList',{ params }).then(res=>{
        resolve(res)
      })
      .catch(err => reject(err))
    }
  })
}


// 获取韦恩图数据  Ranking of alarms for stationed units
export function getAmbulanceVennList(instance, params = {}){
  return new Promise(function(resolve, reject){
    if (instance) {
      instance.proxy.$http.get('alarmManagement.getAmbulanceVennList',{ params }).then(res=>{
        resolve(res)
      })
      .catch(err => reject(err))
    }
  })
}


// 获取告警等级排名  Alarm level proportion
export function getAlarmLevelRankList(instance, params = {}){
  return new Promise(function(resolve, reject){
    if (instance) {
      instance.proxy.$http.get('alarmManagement.getAlarmLevelRankList',{ params }).then(res=>{
        resolve(res)
      })
      .catch(err => reject(err))
    }
  })
}
// 获取告警类型排名  Alarm aggregation diagram
export function getAlarmTypeList(instance, params = {}){
  return new Promise(function(resolve, reject){
    if (instance) {
      instance.proxy.$http.get('alarmManagement.getAlarmTypeList',{ params }).then(res=>{
        resolve(res)
      })
      .catch(err => reject(err))
    }
  })
}
// 获取车辆告警排名  Alarm ranking for vehicle dimensions
export function getAmbulanceAlarmRank(instance, params = {}){
  return new Promise(function(resolve, reject){
    if (instance) {
      instance.proxy.$http.get('alarmManagement.getAmbulanceAlarmRank',{ params }).then(res=>{
        resolve(res)
      })
      .catch(err => reject(err))
    }
  })
}
// 获取报警对比分析  Comparative analysis of alarms
export function getCurve(instance, params = {}){
  return new Promise(function(resolve, reject){
    if (instance) {
      instance.proxy.$http.get('alarmManagement.getCurve',{ params }).then(res=>{
        resolve(res)
      })
      .catch(err => reject(err))
    }
  })
}
// 获取报警对比分析  Comparative analysis of alarms
export function getAlertable(instance, params = {}){
  return new Promise(function(resolve, reject){
    if (instance) {
      instance.proxy.$http.get('alarmManagement.getAlertable',{ params }).then(res=>{
        resolve(res)
      })
      .catch(err => reject(err))
    }
  })
}

// 字典接口  Comparative analysis of alarms   name：camera_algorithm 算法
export function getDictDetail(instance, params = {}){
  return new Promise(function(resolve, reject){
    if (instance) {
      instance.proxy.$http.get('archiveData.dictDetail',{ params }).then(res=>{
        resolve(res)
      })
      .catch(err => reject(err))
    }
  })
}

